﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GmFamilyService.h"
#include "IFamilyForm.h"

namespace gfam
{
    class IFamilySketchCurve;
    class IFamily2DSketchLine;

    /// \brief 基本体基类
    class GM_FAMILY_SERVICE_EXPORT IFamilyGeneralForm : public IFamilyForm
    {
        DEFINE_CAST_DERIVED(gfam::IFamilyGeneralForm, gfam::IFamilyForm)

    public:
        ///\brief 获取底面定位线
        /// 
        /// \return 底面定位线
        virtual const IFamily2DSketchLine* GetBottomLocationLine() const = 0;

        /// \brief 获取顶面定位线
        /// 
        /// \return 顶面定位线
        virtual const IFamily2DSketchLine* GetTopLocationLine() const = 0;

        /// \brief 获取是否在草图编辑中
        /// 
        /// \return 是否正在编辑草图
        virtual bool IsEditingSketch() const = 0;

        /// \brief 设置编辑草图状态
        /// 
        /// \param isEditingSketch 是否正在编辑草图
        virtual void SetEditingSketch(bool isEditingSketch) = 0;

        /// \brief 获取草图编辑的RdId
        /// 
        /// \return 草图编辑的rdid
        virtual RegenDataId GetIsEditingSketchRdId() const = 0;

        /// \brief 根据草图id获取草图
        /// 
        /// \param sketchId 草图id
        /// \return 草图
        virtual IFamilySketch2D* GetSketch(const gcmp::ElementId& sketchId) = 0;

        /// \brief 根据草图id获取草图
        /// 
        /// \param sketchId 草图id
        /// \return 草图
        virtual const IFamilySketch2D*  GetSketch(const gcmp::ElementId& sketchId) const = 0;

        /// \brief 获取锁定图标的位置
        /// 
        /// \return 锁定图标的位置
        virtual gcmp::Vector3d GetPositionOfLockedMark() const = 0;
        
        /// \brief 获取是否与平面关联
        /// 
        /// \return 与平面关联返回true,否则返回false
        virtual bool GetIsLinkedWithPlane() const = 0;

        /// \brief 设置是否与平面关联
        /// 
        /// \param isLinked 关联状态
        /// \return 设置成功返回true,否则返回false
        virtual bool SetIsLinkedWithPlane(bool isLinked) = 0;

        /// \brief 设置关联平面
        /// 
        /// \param planeId 平面id
        /// \return 设置成功返回true,否则返回false
        virtual bool SetLockedPlaneId(const gcmp::ElementId& planeId) = 0;

        /// \brief 获取关联平面id
        /// 
        /// \return 关联平面id
        virtual gcmp::ElementId GetLockedPlaneId() const = 0;
        
        /// \brief 与平面解除关联
        /// 
        /// \return 操作成功返回true,否则返回false
        virtual bool UnlockFromPlane() = 0;

        /// \brief 获取是否是基本体
        /// 
        /// \return 如果是基本体返回true,否则返回false
        virtual bool IsGeneralForm() const = 0;

        /// \brief 获取所有草图线id
        /// 
        /// \param curves  保存草图线id
        virtual void GetAllSketchCurveIds(std::vector<gcmp::ElementId>& curves) const = 0;

    };

} 
